<%--
 *  File:    ProductbrandPopWindow.jsp
 *  @Author: awesomewang
 *  Date:    2009/10/23
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<%//init param
	String privilegeCode = "ALL";
	String strModuleName = "COM";
	String strTableName = "v_zylusrstdarea";
	String contextPath = request.getContextPath();
	
	
%>

<%//--------------------------------------  include files list --%>

<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc"%>


<html>
<head>
<title>ProductbrandPopWindow</title>
<PageFlow:CheckPageFlow pageName="p_zylusrstdarea" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc"%>

<%//--------------------------------------  output variant from pageflow --%>
<%
	Vector prodbrandsummary = (Vector)pageContext.getAttribute("totalsummary");
	if(prodbrandsummary == null) prodbrandsummary = new Vector();
	
%>
<script>
function clickOrg(id,name,code){
	document.frm.stdareaid.value = id;
	document.frm.areaname.value = name;
	document.frm.areacode.value = code;
	
}

function page_summary(actionvalue,orderbyname){
	var editform = summaryPrepare(frm,actionvalue,orderbyname);
	editform.action = "UserStdAreaAllWindow.jsp?<%= OvalTools.randomURL() %>";
	editform.target = "_self";
	isRunning = true;
	editform.submit();  
}
function setParentValue(){
  	if(document.frm.areaname.value != null && document.frm.areacode.value != -1)
    	opener.set_orgNameByAreaWindow(document.frm.stdareaid.value,document.frm.areaname.value);
  	window.close();
}

</script>
</head>

<body>
<form name="frm" method="post" action="../../Dispatcher" target="_parent">
	<input type="hidden" name="pagename" value="p_zylusrstdarea"> 
	<input type="hidden" name="actionname"> 
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<tr>
		<table width="100%" border="0" cellspacing="0">
			<tr>

				<td>
				<table>
					<%@ include file="/inc/SummarySearch.inc"%>
				</table>
				</td>
			</tr>
		</table>		
	</tr>
	<tr>
		<td>
		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
		<tr class="deepblue-left"> 
          <td width="5%" class="deepblue-left">&nbsp;</td>
          <td width="35%" class="title_center">&nbsp;<a href="javascript:page_summary('orderby','areacode')"><%= label.getLabelName("L_AreaCode") %></a></td>
          <td width="40%" class="title_center">&nbsp;<a href="javascript:page_summary('orderby','areaname')"><%= label.getLabelName("L_AreaName") %></a></td>
          <!-- <td width="20%" class="title_center">&nbsp;<a href="javascript:page_summary('orderby','areatype')"><%= label.getLabelName("L_Type") %></a></td> -->
        </tr>
        
        <%
	        int i = 0;
	        String strClassType = new String();   
	        String strIsChecked = "Checked";
	        String strOrgCode = "";     
	        String strOrgName = "";
	        Integer nOrgid = new Integer("-1");
        %>
        <logic:iterate id="orgs" collection="<%= prodbrandsummary %>">                      
        <%
	        HashMap orgMap = (HashMap)pageContext.getAttribute("orgs"); 
	        if(i%2 == 1)
	          	strClassType = "td-listrom";
	        else                    
	          	strClassType = "none";
	          
	        if(i != 0){          
	          	strIsChecked = "";
	        }else{
	        	strOrgCode = (String)(orgMap.get("areacode"));         
	        	strOrgName = (String)(orgMap.get("areaname"));
	        	nOrgid = (Integer)(orgMap.get("stdareaid"));
	        }
	        i++;     
         %>           
        <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'" onClick="javascript:radiotrue('cbox<%=JspHelper.filterNull( i )%>');javascript:clickOrg('<%= orgMap.get("stdareaid") %>','<%=orgMap.get("areaname")%>','<%=orgMap.get("areacode")%>')" class="<%= strClassType %>">
			<td class="<%= strClassType %>"> 
	        	<input id=cbox<%= i %> type="radio" name="radiobutton" value="<%= orgMap.get("stdareaid") %>" <%= strIsChecked %> class="normalradio">
      		</td>
            <td class="<%= strClassType %>">&nbsp;<%= orgMap.get("areacode") %></td>
            <td class="<%= strClassType %>">&nbsp;<%= orgMap.get("areaname") %></td>
            <!--  <td class="<%= strClassType %>">&nbsp;<custom:write dictType="ZYLAreaType" property="areatype" name="orgs"/></td>-->
        </tr>
        </logic:iterate>  
               
       	<input type="hidden" name="areacode" value="<%= strOrgCode %>">    
	    <input type="hidden" name="areaname" value="<%= strOrgName %>">
	    <input type="hidden" name="stdareaid" value="<%= nOrgid %>">
	   
		<%@ include file="/inc/SummaryAction.inc" %>
          
		</table>
		<%//--------------------------------------  page operation button --%>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				<td class="td_center"><a onclick="javascript:setParentValue();"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60" /></a></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>


